//package com.lt.test.consumer.controller;
//
//import com.alibaba.dubbo.config.annotation.Reference;
//import com.lt.test.api.CountService;
//import com.lt.test.common.constant.HttpRequestConstant;
//import com.lt.test.entity.DTO.ResponseDTO;
//import com.lt.test.consumer.util.WebUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.Model;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.Enumeration;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
///**
// * 创建人：lt
// * 创建时间：15:16 2018/1/25
// */
//@Controller
//@RequestMapping("/count")
//public class CountController {
//
//    @Reference(version = "1.0.0")
//    CountService countService;  //扫码出货 service
//    /**
//     * 跳转扫码出货汇总查询页面
//     *
//     * @return
//     */
//    @RequestMapping("/scanCode")
//    public String scanCode() {
//        return "content/count/scanCode";
//    }
//
//    /**
//     * 获取扫码出货
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getScanCode")
//    public @ResponseBody
//    ResponseDTO  getScanCode(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        Map<String, Object> result = getMap(request);
//
//        Map<String, String> user = new HashMap<>();
//        WebUtils.managerStringMap(user);
//
//
//        String fiveChannelCode = user.get("fiveChannelCode");
//
//        ResponseDTO responseDTO = new ResponseDTO();
//        List data = countService.getScanCode(result);
//
//
//
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("获取扫码出货成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 跳转订单结算情况统计页面
//     *
//     * @return
//     */
//    @RequestMapping("/order")
//    public String order() {
//        return "content/count/order";
//    }
//
//    /**
//     * 获取订单结算情况统计
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getOrder")
//    public @ResponseBody
//    ResponseDTO getOrder(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        Map<String, Object> result = getMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        Map<String, String> user = new HashMap<>();
//        WebUtils.managerStringMap(user);
//        String fiveChannelCode = user.get("fiveChannelCode");
//        result.put("fiveChannelCode", fiveChannelCode);
//        System.out.println("=============>"+responseDTO);
//        List data = countService.getOrder(result);
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("获取订单结算情况统计成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 跳转订单结算失败明细页面
//     *
//     * @return
//     */
//    @RequestMapping(value = "/orderEcror", method = {RequestMethod.GET, RequestMethod.POST})
//    public String orderEcror(HttpServletRequest request, Model model) throws Exception {
//        Map<String, Object> result = getMap(request);
//        String shortName = request.getParameter("shortName");
////        String shortName = result.get("shortName") == null ? "" : result.get("shortName").toString();
//        model.addAttribute("shortName", shortName);
//        System.out.println(shortName);
//        return "content/count/orderEcror";
//    }
//
//    /**
//     * 获取订单结算失败明细
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getOrderEcror")
//    public @ResponseBody
//    ResponseDTO getOrderEcror(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        String shortName = request.getParameter("shortName");
//        String turnCreateDate = request.getParameter("turnCreateDate");
//        String bindCreateDate = request.getParameter("bindCreateDate");
//        Map<String, Object> result = new HashMap<>();
//        result.put("shortName",shortName);
//        result.put("turnCreateDate",turnCreateDate);
//        result.put("bindCreateDate",bindCreateDate);
//        System.out.println("======== result ====>"+result);
//        ResponseDTO responseDTO = new ResponseDTO();
//        System.out.println("======== responseDTO ===>"+responseDTO);
//        List data = countService.getOrdeEcror(result);
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("获取订单结算失败明细成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 跳转订单结算情况统计页面
//     *
//     * @return
//     */
//    @RequestMapping("/recommendOrde")
//    public String recommendOrde() {
//        return "content/count/recommendOrde";
//    }
//
//    /**
//     * 获取周列表
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getWeekList")
//    public @ResponseBody
//    ResponseDTO getWeekList(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        Map<String, Object> result = getMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        System.out.println("=============>"+responseDTO);
//        List data = countService.getWeekList();
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("获取周列表成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 获取推荐订单总汇
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getRecommendOrde")
//    public @ResponseBody
//    ResponseDTO getRecommendOrde(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        Map<String, Object> result = getMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        System.out.println("=============>"+responseDTO);
//        List data = countService.getRecommendOrde(result);
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("推荐订单总汇成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 烟草订单页面跳转
//     * @return
//     */
//    @RequestMapping("tobaccoOrde")
//    public String tobaccoOrde(){
//        return "content/count/tobaccoOrde";
//    }
//
//    /**
//     * 获取烟草订单数据
//     * @param request
//     * @return
//     * @throws Exception
//     */
//    @RequestMapping("/getTobaccoOrde")
//    public @ResponseBody
//    ResponseDTO getTobaccoOrde(HttpServletRequest request) throws Exception {
//        request.setCharacterEncoding("utf-8");
//        Map<String, Object> result = getMap(request);
//        ResponseDTO responseDTO = new ResponseDTO();
//        System.out.println("=============>"+responseDTO);
//        List data = countService.getTobaccoOrde(result);
//        responseDTO.setCode(HttpRequestConstant.REQUEST_SUCCESS_CODE);
//        responseDTO.setMessage("获取烟草订单数据成功");
//        responseDTO.setSuccess(true);
//        responseDTO.setData(data);
//        return responseDTO;
//    }
//
//    /**
//     * 从URL获取所有参数列表
//     * @param request
//     * @return
//     */
//    public static HashMap getMap(HttpServletRequest request) throws Exception {
//        HashMap hashMap = new HashMap();
//        Enumeration enums = request.getParameterNames();
//        String paramName = null;
//        String paramValue = null;
//        while (enums.hasMoreElements()) {
//            paramName = (String) enums.nextElement();
//            paramValue = new String(request.getParameter(paramName).getBytes("iso8859-1"),"utf-8");
//            hashMap.put(paramName, paramValue);
//        }
//        return hashMap;
//    }
//
//
//}
